﻿using WenAntdUI.Extensions;

namespace WenAntdUI;

public static class Helper
{
    /// <summary>
    /// 获取table 列编辑模型
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <param name="table"></param>
    /// <returns></returns>
    public static TableColumnBuilder<T> GetTableColumnBuilder<T>(this AntdUI.Table table) where T : class
    {
        return new TableColumnBuilder<T>(table);
    }

    /// <summary>
    /// 判断是否处于设计模式
    /// </summary>
    /// <param name="c"></param>
    /// <returns></returns>
    public static bool GetIsDesign(this Control c)
    {
        return IsDesign;
    }

    /// <summary>
    /// 是否处于设计模式中
    /// </summary>
    public static bool IsDesign => AppDomain.CurrentDomain.FriendlyName == "DesignToolsServer";

}
